package com.bosssoft.trainee.nontax.util.mapper.poDto;

import com.bosssoft.trainee.nontax.entity.dto.ResourceDto;
import com.bosssoft.trainee.nontax.entity.po.Resource;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @Description: resource dto po transform util class
 * @Author: Luo WenLong
 * @Date: 2022/6/25 9:03
 */
@Mapper(componentModel = "spring")
public interface ResourcePoDto {
    /**
     * @Description: po to dto
     * @param resource resource
     * @return: com.bosssoft.trainee.nontax.entity.dto.ResourceDto
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    ResourceDto po2dto(Resource resource);
    /**
     * @Description: po to dto
     * @param resources resource list
     * @return: java.util.List<com.bosssoft.trainee.nontax.entity.dto.ResourceDto>
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    List<ResourceDto> po2dto(List<Resource> resources);

    /**
     * @Description: dto to po
     * @param resourceDto resource
     * @return: com.bosssoft.trainee.nontax.entity.po.Resource
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    @Mappings({
            @Mapping(target = "updateTime", source = "")
    })
    Resource dto2po(ResourceDto resourceDto);

    /**
     * @Description: dto to po
     * @param resourceDto resource list
     * @return: java.util.List<com.bosssoft.trainee.nontax.entity.po.Resource>
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    List<Resource> dto2po(List<ResourceDto> resourceDto);
}
